import request from '@/utils/request'

// 查询支付列表
export function listPayment(query) {
  return request({
    url: '/tws/payment/list',
    method: 'get',
    params: query
  })
}

// 查询待支付列表
export function payList(query) {
  return request({
    url: '/tws/payment/payList',
    method: 'get',
    params: query
  })
}

// 查询支付详细
export function getPayment(id) {
  return request({
    url: '/tws/payment/' + id,
    method: 'get'
  })
}

// 新增支付
export function addPayment(data) {
  return request({
    url: '/tws/payment',
    method: 'post',
    data: data
  })
}

// 线下支付
export function payoff(data) {
  return request({
    url: '/tws/payment/payoff',
    method: 'post',
    data: data
  })
}

// 修改支付
export function updatePayment(data) {
  return request({
    url: '/tws/payment',
    method: 'put',
    data: data
  })
}

// 删除支付
export function delPayment(id) {
  return request({
    url: '/tws/payment/' + id,
    method: 'delete'
  })
}

/**
 * 基于资金单上传订单、司机、车辆至省平台
 * @param {*} paymentId 支付单id
 */
export function uploadPay(paymentId) {
  return request({
    url: '/tws/payment/upload/' + paymentId,
    method: 'get'
  })
}
